import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pornhub_app/components/app_bar/app_bar_view.dart';
import 'package:pornhub_app/components/tab_bar_indicator/easy_fixed_indicator.dart';
import 'package:pornhub_app/utils/color.dart';

import 'dy_page.dart';
import 'posts_page.dart';

// enum PostsStatus {
//   published, //  已发布
//   underReview, // 审核中
//   rejected, //未通过
// }

class MyPublicationsPage extends StatefulWidget {
  const MyPublicationsPage({super.key});

  @override
  State<StatefulWidget> createState() => _MyPublicationsPageState();
}

class _MyPublicationsPageState extends State<MyPublicationsPage>
    with SingleTickerProviderStateMixin {
  late TabController _tabController;
  final List<Tab> tabs = const [
    Tab(text: '帖子'),
    Tab(text: '抖阴'),
  ];

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarView(
        title: TabBar(
          controller: _tabController,
          isScrollable: false,
          labelColor: COLOR.color_DD001B,
          unselectedLabelColor: COLOR.color_333333,
          indicatorColor: COLOR.color_DD001B,
          tabs: tabs,
          dividerHeight: 0,
          labelStyle: TextStyle(fontSize: 17.w, fontWeight: FontWeight.w600),
          indicator: EasyFixedIndicator(
            color: COLOR.color_DD001B,
            width: 10.w,
            height: 3.w,
          ),
        ),
        isShowBottomLine: true,
      ),
      body: TabBarView(
        controller: _tabController,
        children: const [
          PostsPage(),
          DyPage(),
        ],
      ),
    );
  }
}
